import os
from project import DOC_Process,IMAGE_Process
from win32com import client as wc
import fnmatch

# 韩泽旭
file_path = "D:/课题/data/wzj"
result_path = "D:/课题/data/result"
# 闫佳琪
# path=""
# result_path=""
# 马妍
# path=""
# result_path=""

if __name__ == '__main__':
    wordapp = wc.Dispatch('Word.Application')
    image_time = 0

    list = os.listdir(file_path)
    num = 0
    try:
        for i in list:
            num = num + 1
            print(str(num) + " " + os.path.basename(i))
            type = os.path.splitext(i)[1]
            if type == ".docx" or type == ".doc":
                DOC_Process.fun(os.path.basename(i), wordapp)
            # elif type == ".pdf":
            #
            elif type == ".jpg" or type == ".png" or type == ".jpeg" or type == ".JPG" or type == ".PNG" or type == ".JPEG":
                image_time = image_time + 1
                IMAGE_Process.fun(os.path.basename(i), image_time)
            # elif type==".xls" or type==".xlsx":
            #
            # elif type==".zip" or type==".rar":
    finally:
        wordapp.Quit()
